<?php

namespace app\models\Child;

use Yii;

/**
 * This is the model class for table "init_home_nursing_info".
 *
 * @property integer $nursing_id
 * @property integer $type_id
 * @property string $nursing_name
 * @property integer $nursing_value
 */
class InitHomeNursingInfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'init_home_nursing_info';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['type_id', 'nursing_value'], 'integer'],
            [['nursing_name'], 'string', 'max' => 100],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'nursing_id' => 'Nursing ID',
            'type_id' => 'Type ID',
            'nursing_name' => 'Nursing Name',
            'nursing_value' => 'Nursing Value',
        ];
    }
    
    /*
     * 查询列表
     */
    public function getList()
    {
        $list = $this->find()
                ->select('init_home_nursing_type.*,init_home_nursing_info.nursing_id,init_home_nursing_info.nursing_name,init_home_nursing_info.nursing_value')
                ->join('left join','init_home_nursing_type','init_home_nursing_type.type_id = init_home_nursing_info.type_id')
                ->asArray()
                ->all();
        return $list;
    }
}
